<template>
    <div class="app">
        <my-navbar title="退款售后"></my-navbar>
        <tabbar
                ref="reflectName"
                class="tabbar"
                tabType="top"
                textSelectColor="red"
                textUnselectColor="black"
                tabBackgroundColor="#f2f2f2"
                @pageSelected="pageSelected"
                :tabPages="tabPages"></tabbar>

    </div>
</template>

<style>
    .app{
        background-color: rgba(248, 248, 248, 0.8);
    }

    .app {
        flex: 1
    }

    .tabbar {
        flex: 1;
        width: 750px;
    }
    .navbar {
        width: 750px;
        height: 100px;
    }
    .text {
        font-size: 26px;
    }
</style>

<script>
    import myNavbar from '../../components/myNavbar/myNavbar.vue'
    export default {
        data() {
            return {
                tabPages: [
                   {
                   		title: '待确认',
                   		selectedIcon: 'md-home',
                   		url: './list.js',
                   		tabName: "name"
                   	},
                   	{
                   		title: '已同意',
                   		selectedIcon: 'md-contacts',
                   		url: './isAgree.js',
                   		tabName: "payment"
                   	},
                   	{
                   		title: '已退货',
                   		selectedIcon: 'md-globe',
                   		url: './returnedGood.js',
                   		tabName: "delivery"
                   	},
                   	{
                   		title: '待退款',
                   		selectedIcon: 'md-settings',
                   		url: './waitReturn.js',
                   		tabName: "received"
                   	},
                   	{
                   		title: '已退款',
                   		selectedIcon: 'md-settings',
                   		url: './isReturn.js',
                   		tabName: "waitReturn"
                   	},
                ],
            }
        },
        created() {

        },
        components:{
            myNavbar
        },
        mounted(){
            var _this = this
            // if (app.config.params == '0'){
            //     _this.$refs.reflectName.setCurrentItem('name');
            // }else if (app.config.params == '1'){
            //     _this.$refs.reflectName.setCurrentItem('payment');
            // } else if (app.config.params == '2'){
            //     _this.$refs.reflectName.setCurrentItem('delivery');
            // }else if (app.config.params == '3'){
            //     _this.$refs.reflectName.setCurrentItem('received');
            // }else if (app.config.params == '4'){
            //     _this.$refs.reflectName.setCurrentItem('evaluation');
            // }
        },
        methods: {
            pageSelected(params) {
                if(params.position == 0){
                    this.$refs.reflectName.reload('name');
                }else if (params.position == 1) {
                    this.$refs.reflectName.reload('payment');
                }else if(params.position == 2){
                    this.$refs.reflectName.reload('delivery');
                }else if(params.position == 3){
                    this.$refs.reflectName.reload('received');
                }else if(params.position == 4){
                    this.$refs.reflectName.reload('waitReturn');
                }
            },
        }
    };
</script>
